const Net = require('../../common.js')
Page({
  data: {
    lists: {
      id: 'C7017499095575002020070110110157',
      pay_time: '2020-07-01 11:43:10',
      logistics_info: [{
        status: 1,
        context: '已揽收',
        logistics: '您的包裹已由物流公司揽件',
        time: '2020–07-01 15:25:21'
      }, {
        status: null,
        context: '运输中...',
        logistics: '[北京市]快件交给渣渣辉,正在派送途中（联系电话:1585456456123）',
        time: '2020–07-01 15:25:21'
      }, {
        status: 0,
        context: '运输中...',
        logistics: '[北京市]快件交给渣渣辉,正在派送途中（联系电话:1585456456123）',
        time: '2020–07-01 15:25:21'
      }, {
        status: 3,
        context: '已签收',
        logistics: '家人已签收，感谢使用快递~',
        time: '2020–07-01 15:25:21'
      }]
    }
  },
  onLoad: function (options) {
    var _this = this
    Net.data({
      id: options.id
    })
    _this.onPageInfo()
  },
  onPageInfo() {
    var _this = this
    Net.link('v1/mallLogistics', {
      order_num: _this.data.id
    }, function (res) {
      res.data.data.pay_time = Net.formatTime(res.data.data.pay_time, 'Y-M-D h:m:s')
      _this.setData({
        lists: res.data.data.logistics_list
      })
    }, 'GET', function (err) {})
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {},
  onReachBottom: function () {},
  onShareAppMessage: function () {}
})